import { Injectable } from '@angular/core';
import { HttpClient } from '../../../../../providers/httpClient';
import { Config } from '../../../../../providers/config';

@Injectable()
export class IrpInternalReportDetailService {
	constructor(
		public httpClient: HttpClient,
		public config: Config
	) { }
	
	getOrgid(logonname){
        let postBody = {
            "module": "KSB",
            "method": "IRM_A02_0010",
            "type":"IRM",
            "format":"json",
            "params": {
                "logonname": logonname
            }
        }
        return this.httpClient.post(postBody);
    }

	getIrmReportComment(objid){
		let postBody: any = {
			module: "KSB",
			method: "IRM_A02_0260",
			format: "json",
			type: "IRM",
			params: {
				"objid" :"6116631"
			}
		};
		return this.httpClient.post(postBody, {
			isShowLoading: false
		});

	}
	sendIrmReportComment(orgid,reportid,content){
		let postBody: any = {
			module: "KSB",
			method: "IRM_A02_0470",
			format: "json",
			type: "IRM",
			params: {
				"objid" :orgid,
				"orgid" :orgid,
				"reportid" :"6116631",
				"content" :content
			}
		};
		return this.httpClient.post(postBody, {
			isShowLoading: false
		}
		);

	}
	getIrmReportAttach(reportid){
        let postBody: any = {
			module: "KSB",
			method: "IRM_A02_0270",
			format: "json",
			type: "IRM",
			params: {
			"reportid" :reportid,
			}
		};
		return this.httpClient.post(postBody, {
			isShowLoading: false
		}
		);
	}
}